home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mouseu1a / mouse.frm next >
Text File  |  1999-09-14  |  7KB  |  214 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Mouse_Move And Mouse_Down"
  4.    ClientHeight    =   7650
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   8775
  8.    Icon            =   "Mouse.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   7650
  11.    ScaleWidth      =   8775
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.TextBox Text2 
  14.       DragMode        =   1  'Automatic
  15.       Height          =   375
  16.       Left            =   1920
  17.       TabIndex        =   7
  18.       Tag             =   "text2 text box"
  19.       Text            =   " "
  20.       Top             =   7080
  21.       Width           =   4815
  22.    End
  23.    Begin VB.CheckBox Check4 
  24.       Caption         =   "Right"
  25.       Height          =   255
  26.       Left            =   7800
  27.       TabIndex        =   6
  28.       Top             =   480
  29.       Width           =   855
  30.    End
  31.    Begin VB.CheckBox Check3 
  32.       Caption         =   "Left"
  33.       Height          =   255
  34.       Left            =   6960
  35.       TabIndex        =   5
  36.       Top             =   480
  37.       Width           =   735
  38.    End
  39.    Begin VB.TextBox Text1 
  40.       Alignment       =   2  'Center
  41.       Enabled         =   0   'False
  42.       BeginProperty Font 
  43.          Name            =   "MS Sans Serif"
  44.          Size            =   12
  45.          Charset         =   0
  46.          Weight          =   400
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   375
  52.       Left            =   4440
  53.       MultiLine       =   -1  'True
  54.       TabIndex        =   3
  55.       Top             =   0
  56.       Width           =   4335
  57.    End
  58.    Begin VB.CommandButton Command1 
  59.       Caption         =   "End"
  60.       Height          =   495
  61.       Left            =   7080
  62.       TabIndex        =   2
  63.       Top             =   7080
  64.       Width           =   1575
  65.    End
  66.    Begin VB.CheckBox Check2 
  67.       BackColor       =   &H80000012&
  68.       Caption         =   "Follow"
  69.       ForeColor       =   &H8000000E&
  70.       Height          =   255
  71.       Left            =   120
  72.       TabIndex        =   1
  73.       Tag             =   "Follow Check Box"
  74.       Top             =   6960
  75.       Width           =   1455
  76.    End
  77.    Begin VB.CheckBox Check1 
  78.       BackColor       =   &H80000007&
  79.       Caption         =   "Circles"
  80.       ForeColor       =   &H8000000E&
  81.       Height          =   255
  82.       Left            =   120
  83.       TabIndex        =   0
  84.       Tag             =   "Circle check box"
  85.       Top             =   6480
  86.       Width           =   1455
  87.    End
  88.    Begin VB.Label Label3 
  89.       Caption         =   "Drag this Button and the text box below"
  90.       Enabled         =   0   'False
  91.       Height          =   375
  92.       Left            =   2880
  93.       TabIndex        =   9
  94.       Top             =   6480
  95.       Width           =   3375
  96.    End
  97.    Begin VB.Label Label2 
  98.       Caption         =   "Click Here"
  99.       Enabled         =   0   'False
  100.       BeginProperty Font 
  101.          Name            =   "MS Sans Serif"
  102.          Size            =   18
  103.          Charset         =   0
  104.          Weight          =   400
  105.          Underline       =   0   'False
  106.          Italic          =   0   'False
  107.          Strikethrough   =   0   'False
  108.       EndProperty
  109.       Height          =   855
  110.       Left            =   4560
  111.       TabIndex        =   8
  112.       Top             =   2400
  113.       Width           =   3015
  114.    End
  115.    Begin VB.Label Label1 
  116.       Caption         =   "This is only a training a form to demonstrate mouse up, down, and move functions. "
  117.       Height          =   975
  118.       Left            =   120
  119.       TabIndex        =   4
  120.       Top             =   2040
  121.       Width           =   2535
  122.    End
  123.    Begin VB.Shape Shape1 
  124.       DrawMode        =   1  'Blackness
  125.       FillStyle       =   0  'Solid
  126.       Height          =   1455
  127.       Left            =   0
  128.       Shape           =   4  'Rounded Rectangle
  129.       Tag             =   "Shape1"
  130.       Top             =   6120
  131.       Width           =   1695
  132.    End
  133.    Begin VB.Image Image2 
  134.       Height          =   855
  135.       Left            =   0
  136.       Picture         =   "Mouse.frx":0442
  137.       Stretch         =   -1  'True
  138.       Tag             =   "Image2"
  139.       Top             =   0
  140.       Width           =   855
  141.    End
  142.    Begin VB.Image Image1 
  143.       DragMode        =   1  'Automatic
  144.       Height          =   480
  145.       Left            =   3960
  146.       Picture         =   "Mouse.frx":534D
  147.       Tag             =   "Button"
  148.       Top             =   5640
  149.       Width           =   480
  150.    End
  151. End
  152. Attribute VB_Name = "Form1"
  153. Attribute VB_GlobalNameSpace = False
  154. Attribute VB_Creatable = False
  155. Attribute VB_PredeclaredId = True
  156. Attribute VB_Exposed = False
  157. Option Explicit
  158. Private Sub Check2_Click()
  159. If Check2.Value = 1 Then MsgBox "Click anywhere on the form and the picture will follow"
  160. End Sub
  161. Private Sub Command1_Click()
  162. End
  163. End Sub
  164.  
  165. Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
  166. Source.Move X, Y
  167. End Sub
  168.  
  169. Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
  170. Text2.Text = "You are Moving the " + Source.Tag
  171. End Sub
  172.  
  173. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  174.  If Button = 1 Then
  175.  Text1.Text = "The left button is currently down"
  176.  End If
  177. If Button = 2 Then
  178.  Text1.Text = "The right button is currently down"
  179.  End If
  180.  If Button = 4 Then
  181.  Text1.Text = "The middle button is currently down"
  182.  End If
  183.   If Check2 = 1 Then
  184.    Image2.Move X, Y
  185.   End If
  186.   If (Button And 1) = 1 Then
  187.    Check3.Value = 1
  188.   Else
  189.    Check3.Value = 0
  190.    End If
  191. If (Button And 2) = 2 Then
  192.    Check4.Value = 1
  193.   Else
  194.    Check4.Value = 0
  195. End If
  196.   
  197. End Sub
  198. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  199. If Check1.Value = 1 Then Circle (X, Y), 40
  200. End Sub
  201. Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  202. Image1.BorderStyle = 1
  203.  
  204. End Sub
  205. Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  206. Image1.BorderStyle = 0
  207. End Sub
  208. Private Sub Image2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  209. Image2.BorderStyle = 1
  210. End Sub
  211. Private Sub Image2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  212. Image2.BorderStyle = 0
  213. End Sub
  214.